package com.huawei.simplepiano.fraction;

import com.huawei.simplepiano.ResourceTable;
import com.huawei.simplepiano.utils.ConstantUtils;
import ohos.agp.components.*;
import ohos.app.Context;

public class RangeFiveFraction extends BaseFraction {

    private final Context mContext;

    public RangeFiveFraction(Context context) {
        this.mContext = context;
    }

    @Override
    protected int getLayout() {
        return ResourceTable.Layout_range_five;
    }

    @Override
    public String fractionName() {
        return ConstantUtils.FIVE_FRACTION;
    }

    @Override
    protected void initView() {
        rangeSelectionUtils.startLocalAudioPlay(mContext);
        DirectionalLayout whiteFiveLayout = (DirectionalLayout) getFractionAbility().findComponentById(ResourceTable.Id_five_whiteKey);
        rangeSelectionUtils.setFraction(this);
        rangeSelectionUtils.setContext(this);
        whiteFiveLayout.setTouchEventListener(rangeSelectionUtils.getTouchEventListener());
        rangeSelectionUtils.initButton(ConstantUtils.FIVE_FRACTION);
    }

    @Override
    protected void onStop() {
        super.onStop();
    }
}
